package com.xcm.service;

import com.xcm.model.TbDeviceUpgrade;
import com.xcm.model.vo.DeviceUpgradeListVO;
import com.xcm.page.PageInfo;

import java.rmi.ServerException;
import java.util.List;

/**
 * 终端升级Service
 */
public interface DeviceUpgradeService {
	/**
	 * 通过对应机型获取终端升级
	 * getDeviceUpgradeByModel
	 *
	 * @param model 对应机型
	 * @return TbDeviceUpgrade
	 */
	TbDeviceUpgrade getDeviceUpgradeByModel(String model);


	/**
	 * 通过mac取终端升级
	 * getDeviceUpgradeByMac
	 *
	 * @param mac mac地址
	 * @return TbDeviceUpgrade
	 */
	TbDeviceUpgrade getDeviceUpgradeByMac(String mac);

	/**
	 * 保存终端升级
	 *
	 * @param deviceUpgrade TbDeviceUpgrade对象
	 */
	void saveDeviceUpgrade(TbDeviceUpgrade deviceUpgrade);

	/**
	 * 删除终端升级
	 *
	 * @param deviceUpgradeIds 终端ID字符串集合(如："1,2,3,4,5")
	 */
	void deleteDeviceUpgradeBatch(String deviceUpgradeIds);

	/**
	 * 更新强制升级
	 *
	 * @param deviceUpgradeId 终端升级ID
	 * @param force          是否强制       (1强制升级;0不强制)
	 */
	void updateActive(Long deviceUpgradeId, Integer force);

	/**
	 * 获取终端升级分页列表
	 *
	 * @param model    对应机型
	 * @return Page<TbDeviceUpgrade>
	 */
	PageInfo<DeviceUpgradeListVO> listDeviceUpgradeByPage(String model, Integer pageNum, Integer pageSize);

	/**
	 * 获取所有版本号
	 * @return  List<String>
	 */
	List<String> listAllVersionCode();

	/**
	 * 通过ID获取终端升级
	 *
	 * @param deviceUpgradeId 终端升级ID
	 * @return TbDeviceUpgrade
	 */
	TbDeviceUpgrade getDeviceUpgradeById(Long deviceUpgradeId) throws ServerException;

	/**
	 * 更新终端升级
	 *
	 * @param deviceUpgrade TbDeviceUpgrade
	 */
	void updateDeviceUpgrade(TbDeviceUpgrade deviceUpgrade) throws ServerException;

}
